package com.zhb.designmode.structure.decorator.trytry;

public class Client {

    public static void main(String[] args) {
        Cake cake = new BaseCake();
        //加一份蓝莓
        CakeDecorator decorator = new BlueberryDecorator(cake);
        System.out.println(decorator.getMsg());
        System.out.println(decorator.getPrice());
        //再加一份蓝莓
        CakeDecorator decorator2 = new BlueberryDecorator(decorator);
        System.out.println(decorator2.getMsg());
        System.out.println(decorator2.getPrice());
        //加一份巧克力
        CakeDecorator decorator3 = new ChocolateDecorator(decorator2);
        System.out.println(decorator3.getMsg());
        System.out.println(decorator3.getPrice());
    }
}
